package com.hjw.weixun.service.impl;

import java.util.List;

import com.hjw.weixun.dao.FollowerDao;
import com.hjw.weixun.dao.impl.FollowerDaoJdbcImpl;
import com.hjw.weixun.domain.Follower;
import com.hjw.weixun.domain.User;
import com.hjw.weixun.domain.Weixun;
import com.hjw.weixun.service.FollowerService;

public class FollowerServiceImpl implements FollowerService {

	private FollowerDao followerDao = FollowerDaoJdbcImpl.getInstance();

	public static FollowerService followerService;

	public static FollowerService getInstance() {
		if (followerService == null) {
			followerService = new FollowerServiceImpl();
		}
		return followerService;
	}

	@Override
	public List<Follower> getFollowers(Integer weixunId) {
		return followerDao.getFollowers(weixunId);
	}

	@Override
	public List<Integer> getPubishers(Integer followerId) {
		return followerDao.getPubishers(followerId);
	}

	@Override
	public boolean isFollower(Weixun weixun, User user) {
		// TODO Auto-generated method stub
		return followerDao.isFollower(weixun, user);
	}

	@Override
	public void addFollower(Weixun weixun, User user) {
		followerDao.addFollower(weixun, user);

	}

}
